import { Map } from "immutable";
import {
  CHANGE_PROFILE_MY_NOTE,
  CHANGE_PROFILE_COLLECT_NOTE,
} from "./constant";

const initState = Map({
  profileMyNote: [],
  profileCollectNote: [],
});

export default function reducer(state = initState, { type, data }) {
  switch (type) {
    case CHANGE_PROFILE_MY_NOTE:
      return state.set("profileMyNote", data);
    case CHANGE_PROFILE_COLLECT_NOTE:
      return state.set("profileCollectNote", data);
    default:
      return state;
  }
}
